-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(time-picker): Added min and max props #590
Conversation
Demo will be published at https://apps.inindca.com/common-ui-docs/genesys-webcomponents/feature/COMUI-1736 |
...es/genesys-spark-components/src/components/stable/gux-time-picker/gux-time-picker.service.ts
Outdated
Show resolved
Hide resolved
...spark-components/src/components/stable/gux-time-picker/tests/gux-time-picker.service.spec.ts
Outdated
Show resolved
Hide resolved
packages/genesys-spark-components/src/components/stable/gux-time-picker/example.html
Outdated
Show resolved
Hide resolved
...spark-components/src/components/stable/gux-time-picker/tests/gux-time-picker.service.spec.ts
Outdated
Show resolved
Hide resolved
...es/genesys-spark-components/src/components/stable/gux-time-picker/gux-time-picker.service.ts
Outdated
Show resolved
Hide resolved
LGTM but I think worth bringing up the questions you have with the team |
I was just reading up on how the
Still uncertain how it works in terms of wrapping around midnight but I think you could potentially create a validation function .I think it might be possible to convert the
so this should return true. This is just a rough idea of what I was thinking about but not sure if we want to be thinking about the crossover. |
@gavin-everett-genesys This is ready for review again. Thanks! |
packages/genesys-spark-components/src/components/stable/gux-time-picker/example.html
Show resolved
Hide resolved
Should |
@daragh-king-genesys I think you had mentioned we should not do the min and max for the 12 hour format but correct me if I'm wrong. |
If it is the case that 12 hour format is not supported I would suggest the following
|
@@ -102,6 +108,10 @@ export class GuxTimePicker { | |||
|
|||
this.i18n = await buildI18nForComponent(this.root, translationResources); | |||
this.clockType = this.clockType || getLocaleClockType(this.root); | |||
|
|||
if (this.clockType == '12h' && (this.min || this.max)) { | |||
console.error('clock type must be "24h" when using min/max props'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@katie-bobbe-genesys I had this code here already to check if the clock type is 12h but I used a console error. Should I keep this code but change to a console warn? I'll also do an if
check like you mentioned to ignore the min/max logic in a certain scenario.
return acc.concat( | ||
minuteOptions.map( | ||
minuteOption => `${hourOption}:${minuteOption}` | ||
) as GuxISOHourMinute[] | ||
); | ||
}, [] as GuxISOHourMinute[]); | ||
|
||
return clockType === '24h' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@katie-bobbe-genesys this is where I check if the clocktype is 24h before applying the min/max check.
✅ Closes: COMUI-1736 feat(time-picker): Fixed up min/max logic ✅ Closes: COMUI-1736 feat(time-picker): Fixed up min/max logic to make it more functional ✅ Closes: COMUI-1736 test(time-picker): Added min and max tests ✅ Closes: COMUI-1736 test(time-picker): Fixed 12h test for min and max ✅ Closes: COMUI-1736 chore(time-picker): General refactoring ✅ Closes: COMUI-1736 test(time-picker): Fixed min/max tests ✅ Closes: COMUI-1736 chore(time-picker): Refactoring changes ✅ Closes: COMUI-1736 chore(time-picker): Fixed comment to be more descriptive ✅ Closes: COMUI-1736 test(time-picker): Fixed test title ✅ Closes: COMUI-1736 chore(time-picker): PR feedback ✅ Closes: COMUI-1736 chore(time-picker): Fixed hour conversion logic ✅ Closes: COMUI-1736 chore(time-picker): Variable name change ✅ Closes: COMUI-1736 chore(time-picker): Removed unneeded 12h clock type test ✅ Closes: COMUI-1736 chore(time-picker): Added tests and wrapped around boundary logic ✅ Closes: COMUI-1736 chore(time-picker): Conditional check before applying boundaries ✅ Closes: COMUI-1736 chore(time-picker): Fixed boundary logic to be inclusive of min and max ✅ Closes: COMUI-1736
96dde88
to
bd94bb1
Compare
✅ Closes: COMUI-1736
Added optional min and max props for the time-picker component.